package com.ruoyi.recipe.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.recipe.mapper.RecipeFeedbackMapper;
import com.ruoyi.recipe.domain.RecipeFeedback;
import com.ruoyi.recipe.service.IRecipeFeedbackService;
import com.ruoyi.common.core.text.Convert;

/**
 * 反馈内容Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-23
 */
@Service
public class RecipeFeedbackServiceImpl implements IRecipeFeedbackService 
{
    @Autowired
    private RecipeFeedbackMapper recipeFeedbackMapper;

    /**
     * 查询反馈内容
     * 
     * @param id 反馈内容主键
     * @return 反馈内容
     */
    @Override
    public RecipeFeedback selectRecipeFeedbackById(Long id)
    {
        return recipeFeedbackMapper.selectRecipeFeedbackById(id);
    }

    /**
     * 查询反馈内容列表
     * 
     * @param recipeFeedback 反馈内容
     * @return 反馈内容
     */
    @Override
    public List<RecipeFeedback> selectRecipeFeedbackList(RecipeFeedback recipeFeedback)
    {
        return recipeFeedbackMapper.selectRecipeFeedbackList(recipeFeedback);
    }

    @Override
    public RecipeFeedback selectLatestRecipeFeedback(RecipeFeedback recipeFeedback) {
        return recipeFeedbackMapper.selectLatestRecipeFeedback(recipeFeedback);
    }

    /**
     * 新增反馈内容
     * 
     * @param recipeFeedback 反馈内容
     * @return 结果
     */
    @Override
    public int insertRecipeFeedback(RecipeFeedback recipeFeedback)
    {
        recipeFeedback.setCreateTime(DateUtils.getNowDate());
        return recipeFeedbackMapper.insertRecipeFeedback(recipeFeedback);
    }

    /**
     * 修改反馈内容
     * 
     * @param recipeFeedback 反馈内容
     * @return 结果
     */
    @Override
    public int updateRecipeFeedback(RecipeFeedback recipeFeedback)
    {
        recipeFeedback.setUpdateTime(DateUtils.getNowDate());
        return recipeFeedbackMapper.updateRecipeFeedback(recipeFeedback);
    }

    /**
     * 批量删除反馈内容
     * 
     * @param ids 需要删除的反馈内容主键
     * @return 结果
     */
    @Override
    public int deleteRecipeFeedbackByIds(String ids)
    {
        return recipeFeedbackMapper.deleteRecipeFeedbackByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除反馈内容信息
     * 
     * @param id 反馈内容主键
     * @return 结果
     */
    @Override
    public int deleteRecipeFeedbackById(Long id)
    {
        return recipeFeedbackMapper.deleteRecipeFeedbackById(id);
    }
}
